package cn.zhc.com.http;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;


/**
 * Created by zhouhongchun on 2017/8/4.
 * 建议主项目重新继承该接口
 */

public interface RetrofitApi {


    /**
     * *************************** 示例代码 Start 建议主项目重新继承该接口 **********************************
     */

    @FormUrlEncoded
    @POST("index.php")
    Observable<Object> requestServer1(@Query("timestamp") String timestamp,
                                      @Field("data") String dataPost
    );
    @GET("user/doLogin")
    Observable<Object> requestServer2(@Query("data") String data);

    //post多文件上传，请求参数拼接到url上面
    @Multipart
    @POST("user/user/IDCardRecognize")
    Observable<Object> requestApproveIdentityWithParams(@Query("data") String data,
                                                        @Part() List<MultipartBody.Part> parts,
                                                        @Header("X-SYSTEMTIME") String systemTime,
                                                        @Header("X-SIGN") String sign);
    //post多文件上传，请求参数放到请求体中
    @Multipart
    @POST("user/user/IDCardRecognize")
    Observable<Object> requestApproveIdentityWithRequestBody(@Part("data") String data,
                                                             @Part() List<MultipartBody.Part> parts,
                                                             @Header("X-SYSTEMTIME") String systemTime,
                                                             @Header("X-SIGN") String sign);
    @GET("carSouce/getUserIndexParam")
    Observable<Object> requestNewestCarSourceList();

    /**
     * *************************** 示例代码 End 建议主项目重新继承该接口 **********************************
     */











}
